﻿using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using System.Text;

namespace PefStudio.Windows
{
    [Export(MainWindow.MainMenuContract, typeof(IMenuItem))]
    sealed class MainEditMenus : AbstractMenuItem, IPartImportsSatisfiedNotification
    {
        public const string Contract = "PefStudio.Windows.MainMenu.EditMenu";

        public MainEditMenus()
        {
            ID = "Edit";
            Text = "&Edit";
            Index = 2.0;

            InsertRelativeToID = "File";
        }

        [ImportMany(Contract, typeof(IMenuItem), AllowRecomposition = true)]
        private IEnumerable<IMenuItem> MenuItems { get; set; }

        public void OnImportsSatisfied()
        {
            CreateService.CreateMenu(this.DropDownItems, MenuItems, MainWindow);
        }
    }
}
